home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / repair / repair.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  852b  |  47 lines

  1. /* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by
  2.    reiser4progs/COPYING.
  3.    
  4.    repair/repair.h -- the common structures and methods for recovery. */
  5.  
  6. #ifndef REPAIR_H
  7. #define REPAIR_H
  8.  
  9. #include <reiser4/libreiser4.h>
  10. #include <repair/plugin.h>
  11. #include <misc/gauge.h>
  12.  
  13. enum {
  14.     REPAIR_DEBUG    = 0x0,
  15.     REPAIR_WHOLE    = 0x1,
  16.     REPAIR_NO_MKID    = 0x2,
  17.     REPAIR_YES    = 0X3,
  18.     REPAIR_LAST
  19. };
  20.  
  21. typedef struct repair_data {
  22.     reiser4_fs_t *fs;
  23.     
  24.     uint64_t fatal;
  25.     uint64_t fixable;
  26.     uint64_t sb_fixable;
  27.  
  28.     uint8_t mode;
  29.     char *bitmap_file;
  30.     
  31.     uint32_t flags;
  32. } repair_data_t;
  33.  
  34. extern errno_t repair_check(repair_data_t *repair);
  35.  
  36. #define repair_error_count(repair, error)        \
  37. ({                            \
  38.     if (error > 0) {                    \
  39.         if (error & RE_FATAL)            \
  40.             repair->fatal++;        \
  41.         else if (error & RE_FIXABLE)        \
  42.             repair->fixable++;        \
  43.     }                        \
  44. })
  45.  
  46. #endif
  47.